let header = document.querySelector('.header')
console.log(header);
window.onscroll = () => {
   // 获取滚动距离
   let top = document.documentElement.scrollTop || document.body.scrollTop;
   if (top != 0) {
      console.log(top);
      header.style = "width: 100%;position: fixed; top: 0;    z-index: 999; max-width: 750px;"
   } else {
      console.log(top, 1);
      header.style = "position: static;"
   }
}

